<template>
  <div class="DB-nightingale-container">
    <el-card class="app-container" id="nightingaleEchart"></el-card>
  </div>
</template>

<script>
export default {
  name: 'DB-nightingale',
  props: {
    sectorData: Array,
    default: {},
  },
  data() {
    return {}
  },
  mounted() {
    this.getLoadEcharts()
  },
  methods: {
    getLoadEcharts() {
      var myChart = this.$echarts.init(document.getElementById('nightingaleEchart'))
      const option = {
        tooltip: {
          trigger: 'item',
        },
        legend: {
          top: '5%',
          left: 'center',
        },
        series: [
          {
            name: 'Access From',
            type: 'pie',
            radius: ['40%', '70%'],
            avoidLabelOverlap: false,
            itemStyle: {
              borderRadius: 10,
              borderColor: '#fff',
              borderWidth: 2,
            },
            label: {
              show: false,
              position: 'center',
            },
            emphasis: {
              label: {
                show: true,
                fontSize: '40',
                fontWeight: 'bold',
              },
            },
            labelLine: {
              show: false,
            },
            data: this.sectorData,
          },
        ],
      }
      myChart.setOption(option)
    },
  },
}
</script>

<style lang="less" scoped>
.DB-nightingale-container {
  height: 480px;
  margin-left: 10px;
}
.app-container {
  background-color: #fff;
  border-radius: 10px;
  width: 100%;
  height: 100%;
}
</style>
